<?php
namespace Admin\Controller;
use Think\Controller;
class InfoController extends Controller
{
	public function info()
	{
		$info = M('information');
		$infoList = $info->getField('information_key,information_value');
		$this->assign('information',$infoList);
		$this->display();
	}

	public function updateInfo()
	{
		$title = $_POST['title'];
		$keyword = $_POST['keyword'];
		$description = $_POST['description'];
		$tel = $_POST['tel'];
		$qq = $_POST['qq'];
		$email = $_POST['email'];
		$address = $_POST['address'];
		$domain = $_POST['domain'];
		$copyright = $_POST['copyright'];
		$info = M('information');
		$data = array('title'=>$title,
					'keyword'=>$keyword,
					'description'=>$description,
					'tel'=>$tel,
					'qq'=>$qq,
					'email'=>$email,
					'address'=>$address,
					'domain'=>$domain,
					'copyright'=>$copyright
				);
		//就问你这行代码6不6
		foreach ($data as $key => $val) {
			$info->information_value = $val;
			$info->where('information_key="'.$key.'"')->save();
		}
	}
}